package com.bjpowernode.springboot.service.Impl;

import com.bjpowernode.springboot.dao.BookMapper;
import com.bjpowernode.springboot.entity.BookBean;
import com.bjpowernode.springboot.entity.PageBean;
import com.bjpowernode.springboot.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BookServiceImpl implements BookService {
    @Autowired
    private BookMapper bookMapper;

    @Override
    public int countAllBooks() {
        return bookMapper.countAllBooks();
    }

    @Override
    public List<BookBean> queryBookByInterval(int start, int offset) {
        return bookMapper.queryBookByInterval(start,offset);
    }

    @Override
    public List<BookBean> queryBookByInterval(PageBean pageBean) {
        return this.queryBookByInterval(pageBean.getStart(),pageBean.getOffset());
    }

    @Override
    public void addBook(BookBean bookBean) {

    }

    @Override
    public void deleteBook(int bookId) {

    }

    @Override
    public void updateBookInfo(BookBean bookBean) {

    }
}
